home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / debuging.arc / DIAGS.DOC < prev    next >
Text File  |  1988-04-11  |  19KB  |  412 lines

  1.  
  2.  
  3.       
  4.                                    DIAGS.EXE                                    DIAGS.EXE
  5.       
  6.              Special Serial, Parallel, Video diagnostics for the PC             Special Serial, Parallel, Video diagnostics for the PC
  7.       
  8.           Written by Joan Riff for: 
  9.       
  10.           Computerwise Consulting Services 
  11.           P.O. Box 813, McLean, VA 22101 
  12.           (703) 280-2809 
  13.       
  14.       
  15.      Introduction      ____________
  16.       
  17.      DIAGS is a tool for the advanced PC user, period. It is NOT for the
  18.      general public. This manual will not explain things in elementary terms.
  19.      If you know what a 6845 is, and what an 8250 is, and what parallel
  20.      handshaking lines are, then DIAGS will be extremely useful to you. If
  21.      not, then you may have better things to do with your time than try to
  22.      figure out this program. 
  23.       
  24.      DIAGS started out as a testbed for our new interrupt-driven RS232
  25.      libraries. The Serial Port Diagnostics were the first written, to test
  26.      the Microsoft version 3.0 'C' interface to these routines. 
  27.       
  28.      It has since grown. As we have added more assembler routines to our
  29.      library, we have added corresponding DIAGS functions to test them.
  30.       
  31.      Additionally, DIAGS has been expanded as we experienced the need for new
  32.      diagnostics capabilities. So the Parallel Port diagnostics were added
  33.      when we had to debug yet another unknown printer's handshaking. And the
  34.      6845 diagnostics were added when we needed to test various video tricks
  35.      like displaying 30 lines of text, smooth scrolling, etc. 
  36.       
  37.      As it now stands, DIAGS is a very powerful facility for: 
  38.       
  39.           1) Testing all sorts of asynch communications lines 
  40.       
  41.           2) Testing printer handshaking and cable wiring 
  42.       
  43.           3) Examining an unknown system's DOS environment, including:
  44.  
  45.                a) Interrupt vectors 
  46.                b) Resident device handlers 
  47.       
  48.           4) Directly manipulating the 6845. 
  49.       
  50.  
  51.  
  52.      Main Menu     _________
  53.  
  54.      The main DIAGS menu displays information about the machine and about
  55.      DOS, and presents a list of the various diagnostics that are available.
  56.      When you exit a particular diagnostic, you are returned to this main
  57.      menu.
  58.  
  59.  
  60.      (D)isk Info      ___________
  61.       
  62.      Let's describe the weakest and least important diagnostic first.
  63.       
  64.      The DISK INFO selection from the main menu displays just about every-
  65.      thing that can be determined about a disk. Make sure that you have a
  66.      diskette in the indicated drive before selecting this option. 
  67.       
  68.      Since there are other utilities which do just about everything that you
  69.      may want to do with a disk, we haven't done much with this diagnostic.
  70.      We just display disk information as reported by DOS as well as by the
  71.      disk's Boot Record. 
  72.       
  73.      Once in the Disk Info screen, the following keypresses are available to
  74.      you: 
  75.       
  76.           ESC - return to the main DIAGS menu           ESC
  77.  
  78.           ALT-V - verify a diskette by reading every sector via DOS INT          ALT-V
  79.           025h. This is SLOW!!!! Think of this as a demo of just how
  80.           slow INT 025h can be. 
  81.       
  82.           ALT-R - reset drive. Doesn't do much, huh? That's what we          ALT-R
  83.           wanted to see. 
  84.  
  85.           A thru Z - select new drive for which statistics are to be          A      Z
  86.           displayed. Again, be sure that you have a disk in whatever
  87.           drive you select. 
  88.       
  89.      That's it. Not much to it. If you need to do more, then use: 
  90.       
  91.           The Norton Utilities 
  92.           Quaid's Disk Explorer 
  93.           Central Point Software's Option Board 
  94.       
  95.  
  96.  
  97.  
  98.      (I)nterrupt Vector Display      __________________________
  99.       
  100.      This selection from the main menu displays the system's Interrupt
  101.      Vectors. For each interrupt, the following information is displayed:
  102.       
  103.           The interrupt number 
  104.           The interrupt vector's address within segment zero 
  105.           The Segment:Offset of its handler 
  106.           The interrupt's name and/or use 
  107.       
  108.      If an interrupt points to an IRET, then that fact is reported by a
  109.      highlighted "[IRET]" displayed after the name.                   [IRET]
  110.  
  111.       
  112.      Once in the Interrupt screen, the following keypresses are available to
  113.      you: 
  114.       
  115.           ESC - exit back to main menu           ESC
  116.           Home - scroll display back to Interrupt 0           Home
  117.           End - scroll display to the end of the interrupts (F0 thru FF)          End
  118.           PgDn - scroll to the next page of vectors           PgDn
  119.           PgUp - scroll up to the previous page of vectors           PgUp
  120.           Up Arrow - scroll up 1 line           Up Arrow
  121.           Down Arrow - scroll down 1 line           Down Arrow
  122.       
  123.  
  124.  
  125.      (P)arallel Diagnostics      ______________________
  126.       
  127.      This is a more complicated set of diagnostics. It allows you to do all
  128.      sorts of useful things with the parallel ports. We use these routines
  129.      when we're trying to figure out whether or not some new printer is
  130.      working properly with the system. 
  131.       
  132.      At the top of the screen is displayed: 
  133.       
  134.           The number of parallel ports on the system (1 thru 4) 
  135.           The number of the currently-selected printer (0 thru 3) 
  136.           The base I/O address of the currently-selected printer 
  137.           The trip character that is currently set (see below) 
  138.           Whether interrupts are allowed or disallowed during sampling
  139.       
  140.      The Parallel Port Diagnostics menu gives you the following choices:
  141.       
  142.           (I)nit printer - does a ROM BIOS "init printer" call.           (I)nit printer
  143.       
  144.           (E)nable Interrupts during sampling - toggles the indicator on          (E)nable Interrupts during sampling
  145.           the top line, which indicates whether INTs are to be dis-
  146.           allowed during sampling. 
  147.       
  148.           (N)ew Trip character - allows you to specify a new character          (N)ew Trip character
  149.           to be sent to the printer to 'trip' it. This is initially a
  150.           Linefeed. 
  151.       
  152.  
  153.           (P)rinter switch - selects next printer (in sequence) as the          (P)rinter switch
  154.           current printer. 
  155.       
  156.           (T)rip printer - sends the current Trip character to the          (T)rip printer
  157.           printer, and then captures the printer Status port lines using
  158.           a special high-speed capture routine. These lines are dis-
  159.           played in oscilloscope format, allowing you to see at a glance
  160.           the operation of the BUSY line, ACK line, etc. Interrupts will
  161.           be inhibited during the sampling if the top line of the
  162.           display shows "No Ints". Press ESC to exit from the display of
  163.           the status lines. 
  164.       
  165.           (U)nique Printer setup - sends custom codes to set various          (U)nique Printer setup
  166.           specific printers into various modes. The printers currently
  167.           supported are: 
  168.       
  169.                Data Products 8070 (and perhaps IDS Color Prism) 
  170.                IBM Graphics Printer (and certain Epsons) 
  171.                Fujitsu DL-2600 (and perhaps Epson JX color series) 
  172.                Okidata Microline 93 
  173.                Diable 630 (and C.ITOH Starwriter, F-10, etc) 
  174.                C.ITOH Prowriter 
  175.       
  176.           Follow the prompts that are displayed when you make this
  177.           selection. 
  178.       
  179.           (Q)uit parallel diagnostics - to return to main menu           (Q)uit parallel diagnostics
  180.       
  181.           The following three selections are invaluable for checking
  182.           proper printer cabling and handshaking: 
  183.       
  184.           (D)ata lines - displays the parallel port Data I/O port lines          (D)ata lines
  185.           in oscilloscope-like format. Press ESC to exit the oscillo-
  186.           scope display. 
  187.       
  188.           (S)tatus lines - as above, but lines displayed are from          (S)tatus lines
  189.           the parallel Status I/O port. 
  190.       
  191.           (C)ontrol lines - as above, but lines displayed are from          (C)ontrol lines
  192.           parallel Control I/O port. 
  193.       
  194.           The following selections send various strings to the printer: 
  195.       
  196.           (F)ox message - sends a continuous FOX message to the printer          (F)ox message
  197.           via direct I/O (bypassing the ROM BIOS). Press ESC to stop it.
  198.       
  199.           (A)scii character set - sends the complete ASCII character set          (A)scii character set
  200.           to the printer via direct I/O (bypassing the ROM BIOS). No
  201.           carriage returns are sent. Press ESC to stop it. 
  202.       
  203.           (H)oriz and vert alignment tests - send various Formfeed, Tab,          (H)oriz and vert alignment tests
  204.           line spacing and Backspacing sequences to printer. This is
  205.           useful for testing the results of (U)nique printer setups, and                                            (U)nique
  206.  
  207.           to see if the printer supports true backspacing. This selec-
  208.           tion has its own submenu, which is exited via ESC. 
  209.       
  210.  
  211.  
  212.      (S)erial Port Diagnostics      _________________________
  213.       
  214.      If you do PC communications as much as we do, then this part of DIAGS is
  215.      for you! It provides a very powerful look at the comm line. Its most
  216.      intriguing feature is the ability to serve as a line monitor between two
  217.      serial devices. 
  218.  
  219.      When you select "Serial Diagnostics" from the main menu, your screen
  220.      becomes a terminal screen. At the top of the screen is displayed various
  221.      port information as follows: 
  222.       
  223.           Whether the port is open ("OP") or closed ("CL") 
  224.           The current serial port number 
  225.           The current baud rate 
  226.           The number of data bits being used 
  227.           The type of parity being used 
  228.           The number of stop bits being used 
  229.           Whether the existing 8250 parameters are being re-used (this
  230.                feature is only used by us, for internal testing) 
  231.           What port is being wrapped to (more on this later) 
  232.           Whether keypresses are echoed to the screen 
  233.           Whether DEBUG mode (HEX display) is set 
  234.       
  235.      To the right of this information are various stats, displayed only if
  236.      the port is open and stats have been enabled. These stats include:
  237.  
  238.           The size of the RS232 output queue (in HEX) 
  239.           The size of the RS232 input queue (in HEX) 
  240.           The status of Carrier Detect and DSR 
  241.           The number of times (in HEX) that the following have occurred:
  242.       
  243.                RING 
  244.                BREAK 
  245.                Framing Error 
  246.                Parity Error 
  247.                Overrun Error 
  248.       
  249.      Once the port has been opened, any "normal" keys that you press are sent
  250.      over the comm line by being queued into the output queue. Incoming data
  251.      appears on the screen. Incoming and outgoing characters are displayed in
  252.      different colors, so that you can tell what's what. 
  253.       
  254.      The RS232 routines are entirely interrupt-driven. The output queue will
  255.      be serviced only if the 8250 is properly interrupting the 8088. This in
  256.      itself is a valuable test of proper system operation. If the output or
  257.      input queue sizes stay "stuck" at a non-zero value, then something is
  258.      wrong with your system. 
  259.       
  260.  
  261.  
  262.      Besides the "normal" keys, you may use the following keypresses:
  263.  
  264.       
  265.           ALT-S - switch display between port 0 and port 1 (COM1: and          ALT-S
  266.           COM2:). 
  267.  
  268.           ALT-M - bring up a menu of miscellaneous features:           ALT-M
  269.  
  270.                HANGUP the phone by dropping DTR 
  271.                PICKUP the phone by raising DTR 
  272.                RESET the Hayes 1200b by OUT1 toggle 
  273.                FLUSH input and output queues 
  274.                CRLF control (how to display incoming CR and LF) 
  275.                STATS control - turning the stats off can speed up the
  276.                     terminal display considerable 
  277.                TRAP - control what happens when you press ALT-T to trap
  278.                     some 8250 register 
  279.       
  280.           ALT-X - initiate an XMODEM transfer. This we use to test the          ALT-X
  281.           accuracy of XMODEM as implemented in other software packages. 
  282.  
  283.           ALT-P - control port parameters. This includes:           ALT-P
  284.  
  285.                port OPEN and CLOSE 
  286.                BAUDRATE 
  287.                DATA bit selection 
  288.                PARITY setting 
  289.                STOP bit selection 
  290.                REUSE of the 8250 params (for our internal use) 
  291.                ECHO (of local keypresses) on/off 
  292.                WRAP of incoming data to another comm port 
  293.                DEBUG display toggle 
  294.       
  295.           ALT-T - to trap the data lines from a previously-defined 8250          ALT-T
  296.           register 
  297.  
  298.           ALT-R - display various 8250 registers           ALT-R
  299.  
  300.           ALT-B - to send a BREAK           ALT-B
  301.  
  302.           ALT-W - wait (do nothing) till next keypress. This is useful          ALT-W
  303.           for pausing a fast-miving display. 
  304.  
  305.           ALT-Q - quit back to main menu           ALT-Q
  306.  
  307.           ALT-F - send a single FOX message over comm line           ALT-F
  308.       
  309.      Most of these functions contain their own prompts, and require no
  310.      further explanation. Some, however, need to be explained in detail.
  311.       
  312.      The continuous updating of the stats on the top line can slow down the
  313.      terminal display. Turning stats off (ALT-M S) can speed things up
  314.      considerably. 
  315.       
  316.  
  317.      The baudrate is continuously variable, from 2 to 38400. You are not
  318.      limited to "standard" PC baud rates. 
  319.       
  320.      If you want to clear the screen and reset the stats, try switching ports
  321.      twice (ALT-S ALT-S). 
  322.       
  323.      To trap and display an 8250 register in the middle of communication, you
  324.      must first define the register to be trapped (ALT-M T) and whether INTs
  325.      are to be allowed during the sampling that follows. 
  326.       
  327.      Having done that, you cause the trap by pressing ALT-T. At that instant,
  328.      a special high-speed assembler routine is executed which samples the
  329.      designated register once every 50 machine cycles or so until 420 samples
  330.      have been taken. These sample bytes are then displayed as a screenful of
  331.      HEX bytes. You may highlight a particular byte via the arrow keys. The
  332.      highlighted byte's interpretation is displayed on the message line
  333.      toward the top of the screen. Press ESC to exit this trap display.
  334.       
  335.      The "wrap" feature is very useful. It may be used to allow DIAGS to
  336.      serve as a line monitor located between two serial devices, among other
  337.      things. Every incoming character is "wrapped" as an output to whatever
  338.      port you have specified as the "wrap" port. If you select as the "wrap"
  339.      port the same port that you're using, then you have in effect become a
  340.      full-duplex system. The serial device connected to that port will see
  341.      its "keypresses" echoed back to itself. 
  342.       
  343.      Assuming that you have two serial ports, you may use DIAGS as a line
  344.      monitor by wrapping each port's input to the other port. You can then
  345.      switch between ports (ALT-S) and generally watch everything that goes in
  346.      either direction. You can turn on the DEBUG display (ALT-P G) to see
  347.      things in more detail. 
  348.       
  349.  
  350.  
  351.      (R)esident device handler display      _________________________________
  352.       
  353.      This main menu selection allows you to see a list of all resident device
  354.      handlers. As you highlight each handler's name (via the left and right
  355.      arrow keys), the device's attributes are expanded on the screen. Press
  356.      ESC to exit this display. 
  357.       
  358.      Block devices are indicated by device names of the form "BLOCKnnn",
  359.      where nnn is the number of devices supported by this block device
  360.      handler. 
  361.       
  362.  
  363.  
  364.  
  365.      (V)ideo Manipulation      ____________________
  366.       
  367.      If you want to do some fancy 6845 programming, then the Video diagnostic
  368.      will be of great interest to you. It allows you to examine and alter the
  369.      6845 registers in a most graphic fashion. 
  370.       
  371.      Toward the top of the screen is a two-column list of all 6845 registers,
  372.      and one or two of the special IBM PC video registers (the MODE and/or
  373.      COLOR registers). There is a ">" pointer, showing you which register is                                   >
  374.      being worked with. 
  375.       
  376.      For each 6845 register, two values are shown: 
  377.       
  378.           1) The original value, as set by the ROM BIOS 
  379.           2) The current value as set by you 
  380.       
  381.      You move the ">" pointer to various 6845 registers via the up and down                   >
  382.      arrow keys. As you select each 6845 register, that register's bit
  383.      pattern is expanded on the bottom half of the screen. 
  384.       
  385.      You can change the currently-selected 6845 register's value by using the
  386.      "+" or "-" keypad keys to increment or decrement its value.       +      -
  387.       
  388.      You can also use the left and right arrow keys to move the "bit pointer"
  389.      across the various bits of the expanded byte on the bottom half of the
  390.      screen. Pressing "1" or "0" sets or clears the bit currently pointed                       1      0
  391.      to. This is an alternate way to change the current value of a 6845
  392.      register.
  393.       
  394.      The updated 6845 registers are loaded into the 6845 ONLY WHEN YOU PRESS
  395.      RETURN. This allows you to make extensive changes to registers without
  396.      having intermediate states foul up the display. 
  397.       
  398.      If you hose things up and get an unreadable screen, just press ESC to
  399.      exit the Video Diagnostics, then enter it again. The 6845 is reset on
  400.      exit from the Video Diagnostics. 
  401.       
  402.      If you are using a Color/Graphics Adapter, then you may press "S" to                                                                    S
  403.      toggle Snow on or off. The upper-right corner of the display shows the
  404.      current status of snow as follows: 
  405.       
  406.           "Snow: YES" means that no effort is being made to eliminate           Snow: YES
  407.           snow, and that snow is present (although you won't see it if
  408.           you have a good Color/Graphics board) 
  409.       
  410.           "Snow: NO" means that snow is being eliminated by our video           Snow: NO
  411.           software. 
  412.